<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<html lang="en">
<head>
<base href="<%=basePath%>">
<meta charset="utf-8" />
<title>RSC - index</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="" />
<meta name="author" content="stilearning" />

<link href="css/bootstrap.css" rel="stylesheet" />
<link href="css/bootstrap-responsive.css" rel="stylesheet" />
<link href="css/stilearn.css" rel="stylesheet" />
<link href="css/stilearn-responsive.css" rel="stylesheet" />
<link href="css/stilearn-helper.css" rel="stylesheet" />
<link href="css/stilearn-icon.css" rel="stylesheet" />
<link href="css/font-awesome.css" rel="stylesheet" />
<link href="css/animate.css" rel="stylesheet" />
<link href="css/uniform.default.css" rel="stylesheet" />

<link href="css/select2.css" rel="stylesheet" />
<link href="css/fullcalendar.css" rel="stylesheet" />
<link href="css/bootstrap-wysihtml5.css" rel="stylesheet" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>

<body>
	<!-- section header -->
	<jsp:include page="courier_head.jsp" />

	<!-- section content -->
	<section class="section">
		<div class="row-fluid">
			<!-- span side-left -->
			<jsp:include page="courier_left.jsp" />
			<!-- span side-left -->

			<!-- span content -->
			<div class="span11">
				<!-- content -->
				<div class="content">
					<!-- content-header -->
					<div class="content-header">
						<ul class="content-header-action pull-right">

						</ul>
						<h2>
							<i class="icofont-home"></i>异常派件
						</h2>
					</div>
					<!-- /content-header -->

					<!-- content-body -->
					<div class="content-body">
						<!-- dashboar -->
						<!--datatables-->
						<div class="row-fluid">
							<div class="span12">
								<div class="box corner-all">
									<div class="box-header grd-white corner-top">
										<span></span>
									</div>
									<div class="box-body">
										<table id="datatables"
											class="table table-bordered table-striped responsive">
											<thead>
												<tr>
													<th>&nbsp</th>
													<th>编号</th>
													<th>包裹编号</th>
													<th>任务开始时间</th>
													<th>任务完成时间</th>
													<th>备注</th>
												</tr>
											</thead>
											<tbody>
												<s:iterator value="tasks" id="task" status="index">
													<tr class="odd gradeX">
														<td><s:property value="#index.index+1" />
														<td><s:property value="id" />
														</td>
														<td><a href="#myModal" data-toggle="modal"
															onclick="myFunction('<s:property value="parcel.id"/>')"><s:property
																	value="parcel.id" /> </a></td>
														<td><s:property value="start_time" />
														</td>
														<td><s:property value="finish_time" />
														</td>
														<td><s:property value="parcel.comment" />
														</td>
													</tr>
												</s:iterator>
											</tbody>
										</table>
									</div>
									<!-- /box-body -->
								</div>
								<!-- /box -->
							</div>
							<!-- /span -->
						</div>
						<!--/datatables-->
						<!-- 对话框 -->
						<div id="myModal" class="modal hide fade" tabindex="-1"
							role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
							<div class="modal-header">
								<button type="button" class="close" data-dismiss="modal"
									aria-hidden="true">×</button>
								<h3 id="myModalLabel">包裹详细信息</h3>
							</div>
							<div class="modal-body">
								<div class="control-group">
									<label id="parcel_id" class="control-label"> </label> <label
										id="parcel_sendName" class="control-label"> </label> <label
										id="parcel_sendTel" class="control-label"> </label> <label
										id="parcel_sendAddr" class="control-label"> </label> <label
										id="parcel_recName" class="control-label"> </label> <label
										id="parcel_recTel" class="control-label"> </label> <label
										id="parcel_recAddr" class="control-label"> </label> <label
										id="parcel_size" class="control-label"> </label> <label
										id="parcel_type" class="control-label"> </label> <label
										id="parcel_weight" class="control-label"> </label> <label
										id="parcel_transType" class="control-label"> </label> <label
										id="parcel_status" class="control-label"> </label> <label
										id="parcel_payType" class="control-label"> </label> <label
										id="parcel_comment" class="control-label"> </label>
								</div>
							</div>
							<div class="modal-footer">
								<button class="btn" data-dismiss="modal" aria-hidden="true">关闭</button>
							</div>
						</div>
						<div class="divider-content">
							<span></span>
						</div>
						<!-- tab resume content -->
						<div class="row-fluid">
							<!-- tab resume update -->
							<div class="span6"></div>
							<!-- tab resume update -->
							<div class="span6"></div>
						</div>
						<!-- tab stat -->
					</div>
					<!--/content-body -->
				</div>
				<!-- /content -->
			</div>
			<!-- /span content -->
		</div>
	</section>

	<!-- section footer -->
	<footer>
		<a rel="to-top" href="#top"><i class="icofont-circle-arrow-up"></i>
		</a>
	</footer>

	<!-- javascript
        ================================================== -->
	<!--<script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script>-->
	<script src="js/jquery.js"></script>
	<script src="js/jquery-ui.min.js"></script>
	<script src="js/bootstrap.js"></script>
	<script src="js/uniform/jquery.uniform.js"></script>

	<script src="js/datatables/jquery.dataTables.min.js"></script>
	<script src="js/datatables/extras/ZeroClipboard.js"></script>
	<script src="js/datatables/extras/TableTools.min.js"></script>
	<script src="js/datatables/DT_bootstrap.js"></script>
	<script src="js/responsive-tables/responsive-tables.js"></script>

	<!-- required stilearn template js, for full feature-->
	<script src="js/holder.js"></script>
	<script src="js/stilearn-base.js"></script>

	<script type="text/javascript">
		function myFunction(parcel_id) {
			//	alert(parcel_id);
			$.ajax({
				url : "getParcelInfo",
				dataType : "json",
				type : "post",
				data : {
					"parceid" : parcel_id
				},
				success : function(data) {
					var parcel = eval("(" + data + ")");
					$('#parcel_id').text("订单号：" + parcel.id);
					$('#parcel_sendName').text("寄件人：" + parcel.sendName);
					$('#parcel_sendTel').text("寄件人电话：" + parcel.sendTel);
					$('#parcel_sendAddr').text("寄件人地址：" + parcel.sendAddr);
					$('#parcel_recName').text("收件人：" + parcel.recName);
					$('#parcel_recTel').text("收件人电话：" + parcel.recTel);
					$('#parcel_recAddr').text("收件人地址：" + parcel.recAddr);
					$('#parcel_size').text("包装方式：" + parcel.size);
					$('#parcel_type').text("类型：" + parcel.type);
					$('#parcel_weight').text("重量：" + parcel.weight);
					$('#parcel_transType').text("运送方式：" + parcel.transType);
					$('#parcel_status').text("状态：" + parcel.status);
					$('#parcel_payType').text("付款方式：" + parcel.payType);
					$('#parcel_comment').text("备注：" + parcel.comment);
				},
				error : function() {
					//请求出错处理   
					alert("fuck error");
				}
			});
		}

		$(document)
				.ready(
						function() {
							// try your js

							// uniform
							$('[data-form=uniform]').uniform();

							// datatables
							$('#datatables')
									.dataTable(
											{
												"sDom" : "<'row-fluid'<'span6'l><'span6'f>r>t<'row-fluid'<'span6'i><'span6'p>>",
												"sPaginationType" : "bootstrap",
												"oLanguage" : {
													"sLengthMenu" : "_MENU_ records per page"
												}
											});

							// datatables table tools
							$('#datatablestools')
									.dataTable(
											{
												"sDom" : "<'row-fluid'<'span6'T><'span6'f>r>t<'row-fluid'<'span6'i><'span6'p>>",
												"oTableTools" : {
													"aButtons" : [
															"copy",
															"print",
															{
																"sExtends" : "collection",
																"sButtonText" : 'Save <span class="caret" />',
																"aButtons" : [
																		"xls",
																		"csv",
																		{
																			"sExtends" : "pdf",
																			"sPdfOrientation" : "landscape",
																			"sPdfMessage" : "Your custom message would go here."
																		} ]
															} ],
													"sSwfPath" : "js/datatables/swf/copy_csv_xls_pdf.swf"
												}
											});
						});
	</script>
</body>
</html>
